$(document).ready(function() {
	
});

function OpenPestania(obj){
		
	/*
	indexMenu = obj.replace("content-","");
	
	$("#menuTabla tbody tr").each(function (index){
		
		$(this).children("td").each(function (index2) {
			
			$(this).removeClass("pestana");
			$(this).removeClass("pestana_click");
			
			if(index2 == indexMenu-1){
				$(this).addClass("pestana_click");
			}else{
				$(this).addClass("pestana");
			}
		});	 
		 
	}); 
	*/
	document.getElementById("content-1").style.display="none";
	document.getElementById("content-2").style.display="none";
	document.getElementById("content-3").style.display="none";
	document.getElementById("content-4").style.display="none";
	document.getElementById(obj).style.display="block";
	
}

function start(){
	
	 $.blockUI({ 
		 message:  '<table width="100%"><tr><td style="text-align:center"><img src="img/zoomloader.gif"></td></tr><tr><td style="color:white; text-align:center; font-size: 13px; font-family:Verdana; font-weight : bold;">Cargando...</td></tr></table>',		
		 css: { 
        border: '0px', 
        backgroundColor: 'none', 
        opacity: 1, 
        baseZ: 1010},
		 overlayCSS: {
		 opacity:0.5,
		 'background-Image': 'url(jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png)'
		 },

	 });	 
}

function stop(){	
	$.unblockUI();
}
	
function buscarPersonaEnReniec() { 
	
    var dni  = document.getElementById("txtDni").value;
	
    if(dni!=""){
    	
    dataString = "strDNI=" + dni;
    
    start();
	var url = 'buscarpersona';
	data = "";
	console.log("metodo buscarPersonaEnReniec");
	
		$.getJSON(url, dataString, function(data) {
	
				mostrarDataDeCliente(data);
   			stop();	
   			
			//$( '#tablaGaleria tr' ).remove();								
			
		})
		
	 .done(function() {
		 console.log( " Buscar Persona en Reniec success." );
	 })
	.fail(function(jqxhr, textStatus, error) {
		 
		 stop();	
		 console.log( "Request Buscar Persona en Reniec Failed: " + jqxhr.responseText );	
		 var map =  { mensaje : jqxhr.responseText, codigo: -1 } ;			
		// alert(jqxhr.responseText);
		 
	})
	.always(function() { 
		 //console.log( "P�liza Afiliado complete" );
	});
		  
   	return true;
	 
 }else{
	//alert('Debe al menos ingresar un filtro');
	 var map =  { mensaje : 'Debe ingresar un numero de DNI' , codigo: -1 } ;	
	 alert(map);
	 return false;
 }
}


	

